<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>欢迎页面-X-admin2.0</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <script type="text/javascript" src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script>
    <script type="text/javascript" src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <script type="text/javascript" src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>

    <script>
        var obj=(window.location.href).split("=");
        var id=obj[1].split("&")[0];
        var tableName=obj[2];
        // alert(id+":"+tableName)
        // alert(w_id);
        $.post(
            "../geological/geologicalList",
            "ID="+id+"&tableName="+tableName+"&isDel=0",
            function (geologicals) {
                // alert(geologicals[0].Label);
                console.log(geologicals);
                new Vue({
                    el:"#geUpdate",
                    data:{
                        geological:geologicals
                    },
                    methods:{
                        updateGe:function () {
                            var Label=$("#Label").val();
                            var Type=$("#Type").val();
                            var Father=$("#Father").val();
                            var Reference_ID=$("#Reference_ID").val();
                            var Description=$("#Description").val();
                            var Location=$("#Location").val();
                            var Period=$("#Period").val();
                            $.post(
                                "../geological/updateDzxx",
                                "tableName="+tableName+"&Label="+Label+
                                "&Type="+Type+"&Father="+Father+
                                "&Reference_ID="+Reference_ID+"&Description="+Description+
                                "&Location="+Location+"&Period="+Period+"&ID="+id,
                                function (result) {
                                    alert(result);
                                    // 获得frame索引
                                    var index = parent.layer.getFrameIndex(window.name);
                                    //关闭当前frame
                                    parent.layer.close(index);
                                }
                            );
                        }
                    }
                })
            }
        );
    </script>
</head>

<body>
<div id="geUpdate">
  <div class="x-body">
      <div class="layui-form-item">
          <label for="Label" class="layui-form-label">
              Label:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Label" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].label">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Type" class="layui-form-label">
              Type:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Type" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].type">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Father" class="layui-form-label">
              Father:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Father" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].father">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Reference_ID" class="layui-form-label">
              Reference_ID:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Reference_ID" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].reference_ID">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Description" class="layui-form-label">
              Description:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Description" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].description">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Location" class="layui-form-label">
              Location:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Location" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].location">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Period" class="layui-form-label">
              Period:
          </label>
          <div class="layui-input-inline">
              <input type="text" id="Period" required="" lay-verify="repass"
                     autocomplete="off" class="layui-input" :value="geological[0].period">
          </div>
      </div>
      <div class="layui-form-item">
          <label for="Label" class="layui-form-label"></label>
          <button  class="layui-btn" lay-filter="add" lay-submit="" @click="updateGe()">修改</button>
      </div>

  </div>
</div>
  <script>var _hmt = _hmt || []; (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();</script>
</body>

</html>